<?php
include_once('class.phpmailer.php');

$phone = ($_POST['phone'])? '<p>Phone: '.$_POST['phone'].'</p>' : '';
$body = '<p>Name: '.htmlentities($_POST['name']).'</p><p>E-mail: <a href="mailto:'.$_POST['email'].'">'.$_POST['email'].'</a></p>'.$phone;
$body .= '<p>'.nl2br(htmlentities($_POST['msg-body'])).'</p>';

$mail = new phpmailer();
$mail->PluginDir = "";
$mail->Mailer = "smtp";
$mail->SMTPAuth = true;
$mail->Timeout=30;
$mail->IsHTML(true);
$mail->Body = $body;
$mail->SMTPDebug = 1;

/* MODIFY FROM HERE */
$mail->Host = "smtp.gmail.com";
$mail->Port = '465';
$mail->SMTPSecure = 'tls';
$mail->Username = "aure@greentomato.com.ar";
$mail->Password = "";
$mail->From = "projects@webforce360.com";
$mail->FromName = "Web Force 360";
$mail->AddAddress('aure@greentomato.com.ar');
$mail->Subject = 'Web Force 360 - Contacto';

if(!$mail->Send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
} else {
    echo "Message sent!";
}
?>
